import request from '@/utils/request'

const api = {
    list: '/picture/',
}

//获取banner列表
export function getBannerList(params) {
    return request({
        url: api.list,
        method: 'get',
        params
    })
}

//新增banner
export function addBannerList(data) {
    return request({
        url: api.list,
        method: 'post',
        data
    })
}

//根据获取banner的详情
export function getBannerDetail(id) {
    return request({
        url: `${api.list}${id}/`,
        method: 'get',
    })
}

//删除banner
export function deleteBanner(id) {
    return request({ url: `${api.list}${id}/`, method: 'delete' })
}

//修改banner详情
export function updateBanner(id,data) {
    return request({ url: `${api.list}${id}/`, method: 'patch', data })
}
